{
 "metadata": {
  "signature": "sha256:7b06c3a74cb9d711c36324914a959b376a43db67c61a9895249e3898d151e0de"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "Data Frames\n",
      "=====================\n",
      "\n",
      "> **NOTE**: this entry is outdated. You will likely want to use [pandas](http://pandas.pydata.org/) instead.\n",
      "\n",
      "\n",
      "The [DataFrame.py](files/attachments/DataFrame/DataFrame.py) class, posted by Andrew Straw on the)\n",
      "scipy-user mailing\n",
      "list [original link](http://thread.gmane.org/gmane.comp.python.scientific.user/6860), is an extremely useful tool for using alphanumerical\n",
      "tabular data, as often found in databases. Some data which might be\n",
      "ingested into a data frame could be: || **ID** || **LOCATION** ||\n",
      "**VAL\\_1** || **VAL\\_2** || || 01 || Somewhere || 0.1 || 0.6 || || 02 ||\n",
      "Somewhere Else || 0.2 || 0.5 || || 03 || Elsewhere || 0.3 || 0.4 ||\n",
      "\n",
      "The [DataFrame.py](files/attachments/DataFrame/DataFrame.py) class can be populated from data from a\n",
      "CSV file (comman-separated values). In its current implementation, these\n",
      "files are read with Python's own CSV module, which allows for a great\n",
      "deal of customisation.\n",
      "\n",
      "Example Usage\n",
      "-------------\n",
      "\n",
      "A sample file CSV file from Access2000 is in [CSVSample.csv](files/attachments/DataFrame/CSVSample.csv)\n",
      "We first import the module:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import DataFrame"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "and read the file in using our desired CVS dialect:"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "df = DataFrame.read_csv(\"CSVSample.csv\",dialect=DataFrame.access2000)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "(note that the dialect is actually defined in the DataFrame class). It\n",
      "is often useful to filter the data according to some criterion.\n",
      "\n",
      "Compatibility with Python 2.6 and above\n",
      "---------------------------------------\n",
      "\n",
      "Starting with Python 2.6, the sets module is deprecated, in order to get\n",
      "rid of the warning, replace"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "imports sets"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "with"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "try:\n",
      "    set\n",
      "except NameError:\n",
      "    from sets import Set as set"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}